package cn.ahut.test2;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringTest1 {
	@Test
	//Spring的生命周期测试类
	public void test(){
		ClassPathXmlApplicationContext applicationContext = 
				new ClassPathXmlApplicationContext("applicationContext.xml");
		//初始化Bean
		InteProduct p = (InteProduct) applicationContext.getBean("product");
		
		p.add();
		
		//销毁Bean
		applicationContext.close();
	}
}
